import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

class BgImgBox extends HookWidget {
  const BgImgBox(
      {super.key,
      this.borderRadius,
      this.margin,
      required this.assetImage,
      this.child,
      this.height,
      this.padding,
      this.width});
  final BorderRadiusGeometry? borderRadius;
  final String assetImage;
  final Widget? child;
  final double? height;
  final double? width;
  final EdgeInsetsGeometry? margin;
  final EdgeInsetsGeometry? padding;
  @override
  Widget build(BuildContext context) {
    return Container(
        height: height,
        width: width,
        padding: padding,
        margin: margin,
        clipBehavior: Clip.hardEdge,
        decoration: BoxDecoration(
            image: DecorationImage(image: AssetImage(assetImage)),
            borderRadius: borderRadius ?? BorderRadius.circular(0)),
        child: child);
  }
}
